# makefile for manadoc
# Copyright (c) 2003 Shun Moriya <shun126@users.sourceforge.jp>
# 
# The MIT License
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# 
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# 
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
# THE USE OR OTHER DEALINGS IN THE SOFTWARE.

TARGET	= manadoc
CC	= g++
CFLAGS	= -O3 -DTIXML_USE_STL -I tinyxml
LK	= $(CC)
LFLAGS	= 

RM	= rm -f

HEADERS	= main.h babel/babel.h
SOURCES	= main.cpp babel/babel.cpp
OBJECTS	= main.o babel/babel.o
TINYXML =	tinyxml/tinyxml.o \
		tinyxml/tinyxmlerror.o \
		tinyxml/tinyxmlparser.o \
		tinyxml/tinystr.o \

.SUFFIXES: .cpp .o

$(TARGET): $(SOURCES) $(OBJECTS)
	make -C tinyxml
	$(LK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(TINYXML)

.cpp.o: $(HEADERS)
	$(CC) -c $(CFLAGS) -o $@ $<

clean:
	make -C tinyxml clean
	$(RM) $(TARGET) $(OBJECTS)

depend:
	makedepend -Y -- $(CFLAGS) -- $(SOURCES) 2>/dev/null

# DO NOT DELETE

main.o: babel/babel.h main.h tinyxml/tinyxml.h tinyxml/tinystr.h
babel/babel.o: babel/babel.h babel/sjis-euc.dat babel/euc-sjis.dat
babel/babel.o: babel/c932-uni.dat babel/uni-c932.dat babel/euc2-uni.dat
babel/babel.o: babel/euc3-uni.dat babel/uni-euc.dat babel/sjis-scr.dat
babel/babel.o: babel/euc-scr.dat babel/uni-scr.dat
